﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;


namespace CodeRepositoryConsole.FCL
{
    public class DateTimeSnippet
    {
        /// <summary>
        /// <seealso cref="https://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx"/>
        /// <seealso cref="https://stackoverflow.com/questions/11272417/how-to-get-dayofweek-in-a-local-cultureinfo"/>
        /// </summary>
        public void CustomFormat()
        {
            var day = DateTime.Now.ToString("dddd");
            Console.WriteLine(" default cultureInfo: " + day);
            day = DateTime.Now.ToString("dddd", new CultureInfo("zh-CN"));
            Console.WriteLine(" zh-CN: " + day);
            day = DateTime.Now.ToString("dddd", new CultureInfo("en-US"));
            Console.WriteLine(" en-US: " + day);

            day = DateTime.Now.ToString("ddd", new CultureInfo("zh-CN"));
            Console.WriteLine(" zh-CN abbreviated " + day);

            day = DateTime.Now.ToString("dd", new CultureInfo("zh-CN"));
            Console.WriteLine(" zh-CN day of month number[dd] " + day);

            day = DateTime.Now.ToString("dd", new CultureInfo("zh-CN"));
            Console.WriteLine(" zh-CN day of month number[d] " + day);

        }
    }
}
